﻿from google.appengine.api import users      
from entities import *
from utilities import *
def Menu():
    user = users.get_current_user()
    greeting = Utils.signin()
    
    menu = '<script src="static/cufon-yui.js" type="text/javascript"></script>'
    menu += '<script src="static/cufon-replace.js" type="text/javascript"></script>'
    menu += '<script src="static/Myriad_Pro_300.font.js" type="text/javascript"></script>'
    menu +=  '<div id="header">'
    menu +='            <div class="extra"><img src="images/header-img.jpg" alt="" /></div>'
    menu +=' 			<div class="row-1">'
    menu +=' 				<div class="fleft"><a href="home.html"><img src="images/logo2.gif" alt="" /></a></div>'
    menu +=' 				<div class="fright"><img src="images/phone.gif" alt="" /></div>'
    menu +=' 			</div>'
    menu +=' 			<div class="row-2">'
    menu +=' 				<ul>'
    menu +=' 					<li class="m1"><a href="/" >Trang Chủ </a></li>'
    if (user):
        TenVaiTro = NguoiDungEntities.GetTenVaiTro(user)
        if NhaTuyenDungEntities.GetCurrent(user.nickname()) !=None:    
            menu +="    <li class='m2'> <a href = '/managerJob' > ĐĂNG TUYỂN</a></li>"
        else:
            menu +="    <li class='m2'> <a href = '/formCompany' > COMPANY  </a></li> "    
        if TenVaiTro == "Admin":
            menu += "   <li class='m3'><a href = '/AdminSite'  > ADMIN</a></li>"              
        else: 
            if TenVaiTro != "Developer":
                menu += "   <li class='m3'><a href = '/AdminSite' > DEVELOPER </a></li>"
            else: 
                menu += "   <li class='m3'><a href = '/DeveloperSite' > QUẢN LÝ  </a></li>" 
    else:
        menu +=' 					<li class="m2"><a href="/aboutUs">Giới Thiệu</a></li>'
        menu +=' 					<li class="m3"><a href="/services">Dịch Vụ</a></li>'        
    menu +=' 					<li class="m4"><a href="/searchJob">Tìm Việc</a></li>'
    menu +=' 					<li class="m5"><a href="/contactUs">Liên Hệ</a></li>'    
    menu +=' 	    <li class="m6"><a href="/siteMap">Sitemap</a></li>'
    menu +=' 				</ul>'
    menu +=' 			</div>'
    menu +=' 			<div class="row-3"> EJOB FIND YOUR WORD- FIND YOUR LIFE'
    menu +=' 				<form action="" method="post" id="search-form">'
    menu +=' 					<fieldset>'
    menu +=' 					<div><span>'
    menu +=' 						<input type="text" value="Enter keyword here" />'
    menu +=' 						</span><a href="#" ><img src="images/button.gif" alt="" /></a></div>'
    menu +=' 					</fieldset>'
    menu +=' 				</form>'
    menu += '<br />' + greeting
    menu +=' 			</div>'
    menu +=' 		</div>   '    
    return menu
 
 
def Footer():
    footer = '<div id="footer">'
    footer +=     '<div class="indent">'
    footer +=  '     <div class="fleft">Copyrights - Trần Đắc Long - CNPM K51 - ĐHBK Hà Nội</div>'
    footer +=   '    <div class="fright">Designed by: <a href="http://www.templates.com">'
    footer +=  '   </div>'
    footer +=  ' </div>'
    footer +=  '</div>'
    return footer